class PacsunUserBo {
  final int id;
  final String aid;
  final String nickName;
  final String? imageUrl;
  final double createTime;
  final double updateTime;
  final String? fullName;
  final String? email;
  final String? address;
  final String? socialAccounts;
  final int userType;
  final String? bio;
  final int? taskCountId;
  final String? inviterAid;
  final String? firstName;
  final String? lastName;
  final String password;
  final String? confirmPassword;
  final String? phone;
  final String? birthday;
  final String? shoppingFor;
  final int? mediaType;
  final int followers;
  final String? tags;
  final String? youAre;
  final String? connected;
  final String? openId;
  final int? flagGuide;

  PacsunUserBo({
    required this.id,
    required this.aid,
    required this.nickName,
    this.imageUrl,
    required this.createTime,
    required this.updateTime,
    this.fullName,
    this.email,
    this.address,
    this.socialAccounts,
    required this.userType,
    this.bio,
    this.taskCountId,
    this.inviterAid,
    this.firstName,
    this.lastName,
    required this.password,
    this.confirmPassword,
    this.phone,
    this.birthday,
    this.shoppingFor,
    this.mediaType,
    required this.followers,
    this.tags,
    this.youAre,
    this.connected,
    this.openId,
    this.flagGuide,
  });

  factory PacsunUserBo.fromJson(Map<String, dynamic> json) {
    return PacsunUserBo(
      id: json['id'] as int,
      aid: json['aid'] as String,
      nickName: json['nickName'] as String,
      imageUrl: json['imageUrl'] as String?,
      createTime: json['createTime'] != null
          ? (json['createTime'] as num).toDouble()
          : 0.0,
      updateTime: json['updateTime'] != null
          ? (json['updateTime'] as num).toDouble()
          : 0.0,
      fullName: json['fullName'] as String?,
      email: json['email'] as String?,
      address: json['address'] as String?,
      socialAccounts: json['socialAccounts'] as String?,
      userType: json['userType'] ?? 0,
      bio: json['bio'] as String?,
      taskCountId: json['taskCountId'] as int?,
      inviterAid: json['inviterAid'] as String?,
      firstName: json['firstName'] as String?,
      lastName: json['lastName'] as String?,
      password: json['password'] ?? '',
      confirmPassword: json['confirmPassword'] as String?,
      phone: json['phone'] as String?,
      birthday: json['birthday'] as String?,
      shoppingFor: json['shoppingFor'] as String?,
      mediaType: json['mediaType'] as int?,
      followers: json['followers'] ?? 0,
      tags: json['tags'] as String?,
      youAre: json['youAre'] as String?,
      connected: json['connected'] as String?,
      openId: json['openId'] as String?,
      flagGuide: json['flagGuide'] as int?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'aid': aid,
      'nickName': nickName,
      'imageUrl': imageUrl,
      'createTime': createTime,
      'updateTime': updateTime,
      'fullName': fullName,
      'email': email,
      'address': address,
      'socialAccounts': socialAccounts,
      'userType': userType,
      'bio': bio,
      'taskCountId': taskCountId,
      'inviterAid': inviterAid,
      'firstName': firstName,
      'lastName': lastName,
      'password': password,
      'confirmPassword': confirmPassword,
      'phone': phone,
      'birthday': birthday,
      'shoppingFor': shoppingFor,
      'mediaType': mediaType,
      'followers': followers,
      'tags': tags,
      'youAre': youAre,
      'connected': connected,
      'openId': openId,
      'flagGuide': flagGuide,
    };
  }
}
